// model
package model

import (
	"database/sql"

	"github.com/jinzhu/gorm"
	"github.com/mattn/go-sqlite3"
)

var DB *gorm.DB

func InitDB() (*gorm.DB, error) {
	db, err := gorm.Open("sqlite3", "goblog.db?_loc=Asia/Shanghai")
	if err == nil {
		DB = db
		//db.AutoMigrate()
	}
	return nil, err
}
